home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume18 / elm2.2 / part04 < prev    next >
Encoding:
Internet Message Format  |  1989-04-12  |  49.0 KB

  1. Subject:  v18i083:  Elm mail system, release 2.2, Part04/24
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: dsinc!syd@uunet.UU.NET (Syd Weinstein)
  7. Posting-number: Volume 18, Issue 83
  8. Archive-name: elm2.2/part04
  9.  
  10. #!/bin/sh
  11. # this is part 4 of a multipart archive
  12. # do not concatenate these parts, unpack them in order with /bin/sh
  13. # file doc/Filter.guid continued
  14. #
  15. CurArch=4
  16. if test ! -r s2_seq_.tmp
  17. then echo "Please unpack part 1 first!"
  18.      exit 1; fi
  19. ( read Scheck
  20.   if test "$Scheck" != $CurArch
  21.   then echo "Please unpack part $Scheck next!"
  22.        exit 1;
  23.   else exit 0; fi
  24. ) < s2_seq_.tmp || exit 1
  25. echo "x - Continuing file doc/Filter.guid"
  26. sed 's/^X//' << 'SHAR_EOF' >> doc/Filter.guid
  27. X.sp 5
  28. XDave Taylor
  29. X.sp
  30. XHewlett-Packard Laboratories
  31. X1501 Page Mill Road
  32. XPalo Alto CA
  33. X94304
  34. X.sp 
  35. Xemail: taylor\s-1@\s+1hplabs.HP.COM  or  hplabs\s-1!\s+1taylor
  36. X.sp 2
  37. X>>> Elm is now in the public trust. Bug reports, comments, etc. to: <<<
  38. X.sp
  39. XSyd Weinstein
  40. XDatacomp Systems, Inc.
  41. X3837 Byron Road
  42. XHuntingdon Valley, PA 19006-2320
  43. X.sp
  44. Xemail: elm\s-1@\s+1dsinc.UUCP  or  dsinc\s-1!\s+1elm
  45. X.sp 4
  46. X.ps 18
  47. X\f3\(co\f1\s12 Copyright 1986, 1987 by Dave Taylor
  48. X.ps 18
  49. X\f3\(co\f1\s12 Copyright 1988, 1989 by The USENET Community Trust
  50. X.ps 10
  51. X.bp 1
  52. X.sp 5
  53. X.ps 14
  54. X\f3The Elm Filter System Guide\f1
  55. X.ds h0 "Elm Filter Guide
  56. X.ds h2 "Version 2.2
  57. X.ds f0 
  58. X.ds f1 "Page %
  59. X.sp
  60. X.ps 10
  61. X(Version 2.2)
  62. X.sp 2
  63. XDave Taylor
  64. X.sp
  65. XHewlett-Packard Laboratories
  66. X1501 Page Mill Road
  67. XPalo Alto CA
  68. X94304
  69. X.sp 
  70. Xemail: taylor\s-1@\s+1hplabs.HP.COM  or  hplabs\s-1!\s+1taylor
  71. X.sp 2
  72. X>>> Elm is now in the public trust. Bug reports, comments, etc. to: <<<
  73. X.sp
  74. XSyd Weinstein
  75. XDatacomp Systems, Inc.
  76. X3837 Byron Road
  77. XHuntingdon Valley, PA 19006-2320
  78. X.sp
  79. Xemail: elm\s-1@\s+1dsinc.UUCP  or  dsinc\s-1!\s+1elm
  80. X.sp 2
  81. XApril 1, 1989
  82. X.ce 0
  83. X.sp 3
  84. X.pg
  85. XOne of the greatest problems with the burgeoning electronic mail
  86. Xexplosion is that I tend to get lots of mail that I don't care about.
  87. XAmusingly, perhaps, I have the equivalent of electronic junk mail.
  88. XNot amusing, however, is the fact that this can rapidly 
  89. Xaccumulate and end up taking over my mailbox.
  90. X.pg
  91. XAt the same time I often get mail that, while it is interesting
  92. Xand important, can easily be filed to be read later, without ever
  93. Xactually having to cluttering up my incoming mailbox.
  94. X.sp 2
  95. XThis, then, is what \f2filter\f1 does!  The \f2filter\f1 program
  96. Xallows you to define a set of rules by which all incoming mail should
  97. Xbe screened, and a subsequent set of actions to perform based on whether
  98. Xthe conditions were met or not.  \f2Filter\f1 also has the ability to mail
  99. Xa summary of what actions it performed on the incoming mail as often as
  100. Xyou'd like.
  101. X.ne 5
  102. X.hu Writing the Rules
  103. X.sp
  104. XThe language for writing \f2filter\f1 rules is pretty simple, actually.
  105. XThe fundamental structure is;
  106. X.nf
  107. X.ti .5i
  108. Xif  (\f2condition\f1)  then  \f2action\f1
  109. X.fi
  110. XWhere \f2condition\f1 is constructed by an arbitrary number of 
  111. Xindividual conditions of the form ``\f2field\f1  \f2relation\f1  \f2value\f1''.
  112. X(an optional further type of rule is of the form ``always \f2action\f1''
  113. Xbut should only be used as the last rule in the ruleset, for obvious
  114. Xreasons).
  115. XThe \f2field\f1 value can be;
  116. X.nf
  117. X.in .5i
  118. Xsubject
  119. Xfrom
  120. Xto
  121. Xlines
  122. Xcontains
  123. X.in 0
  124. X.fi
  125. Xwhere, if ``lines'' is chosen, the \f2relation\f1 can be any of the
  126. Xstandard relationships (`>', `<', `>=', `<=', `!=' and `=').  
  127. XIf another action is
  128. Xchosen, ``contains'' can be used as the relation, ``='', or, if you'd
  129. Xlike, you can skip the relationship entirely (e.g. `subject "joe"').
  130. XThe \f2value\f1 is any quoted string that is to be matched against
  131. Xor number if ``lines'' is the field being considered.
  132. X.sp
  133. XIndividual conditions are joined together by using the word ``and'',
  134. Xand the logic of a condition can be flipped by using ``not'' as the
  135. Xfirst word (e.g. `not subject "joe"').  We'll see more examples of
  136. Xthis later.
  137. X.sp
  138. XNote that the ``or'' logical conjunction isn't a valid part of the
  139. X\f2filter\f1 conditional statement.  
  140. X.sp
  141. XFinally, <\f2action\f1> can be any of;
  142. X.nf
  143. X.in .5i
  144. Xdelete
  145. Xsave   \f2foldername\f1
  146. Xsavecopy  \f2foldername\f1
  147. Xforward  \f2address\f1
  148. Xexecute  \f2command\f1
  149. Xleave
  150. X.in 0
  151. X.fi
  152. Xwhere they result in the actions;  \f3delete\f1 deletes the message;
  153. X\f3save\f1 saves a copy of the message in the specified foldername;
  154. X\f3savecopy\f1 does the same as save, but also puts a copy in your mailbox;
  155. X\f3forward\f1 sends the message to the specified address; 
  156. X\f3execute\f1 feeds the message to the specified command (or complex
  157. Xsequence of commands) as standard input;
  158. Xand \f3leave\f1 leaves the message in your mailbox.
  159. X.sp
  160. XFoldernames can contain any of a number of macros, too, as we'll see in
  161. Xthe example ruleset below.  The macros available for the string fields are;
  162. X.ft CW
  163. X.TS
  164. Xcenter;
  165. Xlf3 lf3
  166. Xl l.
  167. XMacro    Meaning
  168. X%d    day of the month
  169. X%D    day of the week (0-6)
  170. X%h    hour of the day (0-23)
  171. X%m    month of the year (0-11)
  172. X%r    return address of message
  173. X%s    subject of original message
  174. X%S    ``Re: \f2subject of original message\f1''
  175. X.ft CW
  176. X%t    current hour and minute in HH:MM format
  177. X%y    year (last two digits)
  178. X.TE
  179. X.ft 1
  180. X.sp
  181. XThe rules file can also contain comments (any line starting with a `#')
  182. Xand blank lines.  
  183. X.sp 
  184. XThe file itself needs to reside in your home directory and be 
  185. Xcalled \f2.filter-rules\f1.  Here's an example:\fC
  186. X.nf
  187. X # $HOME/.filter-rules
  188. X #
  189. X # Filter rules for the Elm Filter program. Don't change without some
  190. X # serious thought. (remember - order counts)
  191. X #
  192. X # (for Dave Taylor)
  193. X # rule 1
  194. X if (from contains "!uucp") then delete
  195. X # rule 2
  196. X to "postmaster" ? save "/tmp/postmaster-mail.%d"
  197. X # rule 3
  198. X if (to "culture" and lines > 20) ? save "/users/taylor/Mail/culture"
  199. X # rule 4
  200. X subject = "filter test" ? forward "hpldat!test"
  201. X # rule 5
  202. X if [ subject = "elm" ] savecopy "/users/taylor/Mail/elm-incoming"
  203. X # rule 6
  204. X subject = "display-to-console" ? execute "cat - > /dev/console"
  205. X.fi
  206. X\f1(notice the loose syntax \(em there are lots of valid ways to specify a
  207. Xrule in the \f2filter\f1 program!!)
  208. X.sp
  209. XTo translate these into English;
  210. X.sp
  211. X.nr TW \w'1. 'u
  212. X.in .5i
  213. X.ti -\n(TWu
  214. X1. All messages from uucp should be summarily deleted.
  215. X
  216. X.ti -\n(TWu
  217. X2. All mail to postmaster should be saved in a folder (file) called 
  218. X/tmp/postmaster-mail.\f2numeric-day-of-the-week\f1
  219. X
  220. X.ti -\n(TWu
  221. X3. All mail addressed to `culture' with at least 20 lines
  222. Xshould be automatically appended to the folder
  223. X/users/taylor/Mail/culture.
  224. X
  225. X.ti -\n(TWu
  226. X4. All messages that contain the subject `filter test' should be forwarded to
  227. Xme, but via the address `hpldat!test' (to force a non-user forward)
  228. X
  229. X.ti -\n(TWu
  230. X5. All messages with a subject that contains the word `elm' should be saved in
  231. Xthe folder ``/users/taylor/Mail/elm-incoming'' and also dropped into my
  232. Xmailbox.
  233. X
  234. X.ti -\n(TWu
  235. X6. Any message with the subject ``display-to-console'' will be immediately
  236. Xwritten to the console.
  237. X.in 0
  238. X.sp
  239. XNotice that the \f2order\f1 of the rules is very important.  If we, for 
  240. Xexample, were to get a message from `uucp' that had the subject `filter test',
  241. Xthe \f2filter\f1 program would match rule 1 and delete the message.  It 
  242. Xwould never be forwarded to `hpldat!test'.  It is for this reason that
  243. Xgreat care should be taken with the ordering of the rules.
  244. X.ne 5
  245. X.hu Checking the rules out
  246. X.sp
  247. XThe \f2filter\f1 program has a convenient way of check out the rules you 
  248. Xhave written.  Simply invoke it with the \f3-r\f1 (\f3r\f1ules) flag;
  249. X.nf
  250. X.in .5i
  251. X% \f3filter -r\f1
  252. X.ft CW
  253. X.in .5i+\w'Rule 1: 'u
  254. X.ti .5i
  255. XRule 1: if (from = "!uucp") then
  256. XDelete 
  257. X.ti .5i
  258. XRule 2: if (to = "postmaster") then
  259. XSave  /tmp/postmaster-mail.<day-of-week>
  260. X.ti .5i
  261. XRule 3: if (to = "culture" and lines > 20) then
  262. XSave  /users/taylor/Mail/culture
  263. X.ti .5i
  264. XRule 4: if (subject = "filter test") then
  265. XForward  hpldat!test
  266. X.ti .5i
  267. XRule 5: if (subject="elm") then
  268. XCopy  and  Save  /users/taylor/Mail/elm-incoming
  269. X.ti .5i
  270. XRule 6: if (subject="display-to-console") then
  271. XExecute "cat - > /dev/console"\f1
  272. X.ft 1
  273. X.in 0
  274. X.fi
  275. X.sp
  276. XThere are a few things to notice \(em first off, these are the parsed and
  277. Xrebuilt rules, so we can see that they are all in a 
  278. Xconsistent format.  Also, notice on the filename for rule 2 that the
  279. Xprogram has correctly expanded the ``%d'' macro to be the day of the 
  280. Xweek.
  281. X.sp
  282. XIt is \f3highly\f1 recommended that you always check your ruleset before
  283. Xactually letting the program use it!
  284. X.ne 5
  285. X.hu Actually Using the Program
  286. X.sp
  287. XNow the bad news.  If you aren't running \f2sendmail\f1 you cannot use
  288. Xthis program as currently written.  Why?  Because the \f2filter\f1
  289. Xprogram expects to be put in your \f2.forward\f1 file and that is something
  290. Xthat only \f2sendmail\f1 looks at!
  291. X.sp
  292. XThe format for the entry in the \f2.forward\f1 file (located in your
  293. Xhome directory) is simply;
  294. X.nf
  295. X.ti .5i
  296. X"| /usr/local/bin/filter"
  297. X.fi
  298. XAllright, it isn't quite \f2that\f1 simple!  Since \f2filter\f1 will be invoked
  299. Xby processes that don't know where you are logged in, you need to have some
  300. Xway to trap the error messages.  For ease of use, it was decided to have all
  301. Xthe messages written to the file specified by `-o' (or \f2stderr\f1)
  302. Xwhich means that you have two main
  303. Xchoices for the actual entry.  Either;
  304. X.nf
  305. X.ti .5i
  306. X"| /usr/local/bin/filter -o /dev/console"
  307. X.fi
  308. Xwhich will log all errors on the system console (each error is prefixed with
  309. X``filter (\f2username\f1)'' to distinguish it), or;
  310. X.nf
  311. X.ti .5i
  312. X"| /usr/local/bin/filter -o /tmp/joe.filter_errors"
  313. X.fi
  314. XIf you want to have a copy saved to a file.  A possible strategy would be
  315. Xto have the errors written to a file and to then have a few lines in 
  316. Xyour \f2.login\f1 script like:\fC
  317. X.nf
  318. X.ft CW
  319. X.in .5i+\w'if 'u
  320. X.ti .5i
  321. Xif ( -f .filter_errors) then
  322. Xecho  "\ \ "
  323. Xecho "Filter program errors;"
  324. Xcat /tmp/joe.filter_errors
  325. Xecho "\ \ "
  326. X.ti .5i
  327. Xendif\f1
  328. X.in 0
  329. X.ft 1
  330. X.fi
  331. XYou can also use the \f3-v\f1 flag in combination with the above to have
  332. Xa more verbose log file saved by having
  333. Xyour \f2.forward\f1 file;
  334. X.nf
  335. X"| /usr/local/bin/filter -vo /tmp/joe.filter_errors"
  336. X.fi
  337. XSuffice to say, you can get pretty tricky with all this!!
  338. X.ne 5
  339. X.hu Summarizing the Actions Taken
  340. X.sp
  341. XThe \f2Filter\f1 program keeps a log of all actions performed, including
  342. Xwhat rules it matched against, in your home directory in a file 
  343. Xcalled \f2.filter_log\f1.  You can either directly operate on this file,
  344. Xor, much more recommended, you can one of the two summarize flags to
  345. Xthe program and let \f2it\f1 do the work for you!
  346. X.sp
  347. XThe difference between the two is best demonstrated by example:
  348. X.nf
  349. X% \f3filter -s\f1
  350. X.ft CW
  351. X.in .5i
  352. X                Summary of Filter Activity
  353. X                \l'\w'Summary of Filter Activity'u-'
  354. XA total of 418 messages were filtered:
  355. XThe default rule of putting mail into your mailbox
  356. X.in .5i+\w'Rule #1: 'u
  357. Xapplied 364 times (87%)
  358. X.ti .5i
  359. XRule #1: (delete message)
  360. Xapplied 1 time (0%)
  361. X.ti .5i
  362. XRule #2: (save in "/users/taylor/Filtered-Mail/netnews.12")
  363. Xapplied 8 times (2%)
  364. X.ti .5i
  365. XRule #3: (save in "/users/taylor/Filtered-Mail/postmaster.12")
  366. Xapplied 14 times (3%)
  367. X.ti .5i
  368. XRule #5: (save in "/users/taylor/Filtered-Mail/risks.12")
  369. Xapplied 3 times (1%)
  370. X.ti .5i
  371. XRule #6: (save in "/users/taylor/Filtered-Mail/rays.12")
  372. Xapplied 28 times (7%)
  373. X.ft 1
  374. X.ti 0
  375. Xversus:
  376. X.ti .5i
  377. X% \f3filter -S\f1
  378. X.ti .5i
  379. X\f2the output as listed above, followed by:\f1
  380. X.ft CW
  381. X.ti .5i
  382. XExplicit log of each action;
  383. X.ti .5i
  384. XMail from taylor about Filter Summary
  385. XPUT in mailbox: the default action
  386. X.ti .5i
  387. XMail from news@hplabsz.hpl.hp.com about Newsgroup comp.editors created
  388. XPUT in mailbox: the default action
  389. X.ti .5i
  390. XMail from root about Log file: cleanuplog
  391. XPUT in mailbox: the default action
  392. X.ft 1
  393. X.ti .5i
  394. X[etc etc]
  395. X.in 0
  396. X.ft 1
  397. X.fi
  398. XTo actually use either of the summarizing options, there 
  399. Xare two ways that are recommended;
  400. X.sp
  401. XThe preferred way is to have a line in either your \f2crontab\f1
  402. X(ask your administrator for help with this) that invokes the \f2filter\f1
  403. Xprogram as often as you desire with the \f3-s\f1 flag.  For example, I
  404. Xhave a summary mailed to me every morning at 8:00 am:\fC
  405. X.nf
  406. X   0 8 * * * "/usr/local/bin/filter -s | elm -s 'Filter Summary' taylor"
  407. X.fi
  408. X.sp
  409. X\f1An alternative is to have your \f2.login\f1 execute the command each time.
  410. X.sp 2
  411. XNote that if you want to have your log files cleared out each time the 
  412. Xsummary is generated you'll need to use the '-c' flag too.  Also,
  413. Xif you want to keep a long list of actions performed you can do this
  414. Xby saving it as you display it.  A way to do this would be, if you were to
  415. Xhave the invocation in your \f2.login\f1 script, to use:\fC
  416. X.nf
  417. X.in .5i
  418. X.ft CW
  419. Xecho "Filter Log;"
  420. Xfilter -c -s | tee -a PERM.filter.log\f1
  421. X.ft 1
  422. X.in 0
  423. X.fi
  424. Xwhich would append a copy of all the output to the file `PERM.filter.log'
  425. Xand would avoid you having to read larger and larger summaries of
  426. Xwhat the program had done.
  427. X.ne 5
  428. X.hu Further Testing of the Ruleset
  429. X.sp
  430. XWith the \f2readmsg\f1 command available, it is quite easy to test the
  431. Xrules you've written to see if they'll do what you desire.  
  432. X.sp
  433. XFor example, we can use the \f3-n\f1 flag to \f2filter\f1, which means
  434. X`don't actually do this, just tell me what rule you matched, if any, and
  435. Xwhat action you would have performed' (you can see why a single letter 
  436. Xflag is easier to type in!!), and feed it each message in our mailbox 
  437. Xby using a command like;
  438. X.nf
  439. X.in .5i
  440. X% \f3set message=1\f1
  441. X% \f3set total_messages=`messages`\f1
  442. X% \f3while  (1)\f1
  443. X> \f3if ($message > $total_messages) exit\f1
  444. X> \f3echo processing message $message\f1
  445. X> \f3readmsg -h $message | filter -n\f1
  446. X> \f3echo " "\f1
  447. X> \f3@ messages++\f1
  448. X> \f3end\f1
  449. X.in 0
  450. X.fi
  451. Xwhich will then hand each of the messages in your mailbox to the \f2filter\f1
  452. Xprogram and display what action would have been taken with that message and
  453. Xwhy.
  454. X.sp
  455. XFor example, if we do this for a few interesting messages in my mailbox,
  456. Xwe'd end up with output like:
  457. X.ft CW
  458. X.nf
  459. X.in .5i
  460. XMail from taylor about filter test
  461. X.ti +\w'Mail 'u
  462. XFORWARDED to hpldat!taylor by rule;
  463. X.ti +\w'Mail   'u
  464. Xsubject="filter test"  ? forward "hpldat!test"
  465. XMail from bradley%hplkab@hplabsc about Re: AI-ED mailing address for HP
  466. X.ti +\w'Mail 'u
  467. XPUT in mailbox: the default action
  468. XMail from taylor about display-to-console
  469. X.ti +\w'Mail 'u
  470. XEXECUTED "cat - > /dev/console"
  471. X.ft 1
  472. X.in 0
  473. X.fi
  474. X(sharp users will notice that this is exactly the same format as the longer
  475. Xsummary listing)
  476. X.ne 5
  477. X.hu What Forwarded Messages Look Like
  478. X.sp
  479. XWhen a message is forwarded to another user by the \f2action\f1 being specified
  480. Xas ``forward \f2address\f1'', then the program can generate one of two styles
  481. Xof message.  If the message is to you, then it'll simply add it to your mailbox
  482. Xin such a way as to ensure that the return address is that of the person who
  483. Xsent the message and so on.
  484. X.sp
  485. XIf not, then the message is enclosed in a message of the form:
  486. X.in \w'If 'u
  487. X.ft CW
  488. X.nf
  489. XFrom taylor Thu Oct  2 15:07:04 1986
  490. XDate: Thu, 2 Oct 86 15:06:58 pdt
  491. XSubject: "filter test"
  492. XFrom: The filter of taylor@hpldat <taylor>
  493. XTo: hpldat!taylor
  494. XX-Filtered-By: filter, version 1.4
  495. X-- Begin filtered message --
  496. X
  497. X.in +\w'-- 'u
  498. XFrom taylor Thu Oct  2 15:06:41 1986
  499. XDate: Thu, 2 Oct 86 15:06:33 pdt
  500. XFrom: Dave Taylor <taylor>
  501. XSubject: filter test
  502. XJust a simple test.
  503. X.in -\w'-- 'u
  504. X-- End of filtered message --
  505. X.ft 1
  506. X.in 0
  507. X.fi
  508. XThe subject of the actual message is the same as the subject of the 
  509. Xmessage being forwarded, but in quotes.  The `From:'  field indicates
  510. Xhow the message was sent, and the `X-Filtered-By:' identifies what
  511. Xversion of filter is being used.
  512. X.ne 5
  513. X.hu Areas to Improve
  514. X.sp
  515. XWhile the \f2filter\f1 program as presented herein is obviously a
  516. Xnice addition to the set of tools available for dealing with electronic
  517. Xmail, there are some key features that are missing and will be added in
  518. Xthe future based on demand.
  519. X.sp
  520. XAs I see it, the main things missing are;
  521. X.in .5i
  522. X
  523. X.ti -\n(TWu
  524. X1. The ability to use regular expressions in the patterns.  
  525. XThis would be a \f2very\f1 nice feature!
  526. X
  527. X.ti -\n(TWu
  528. X2. Perhaps more \f2actions\f1 available (but what?)
  529. X
  530. X.ti -\n(TWu
  531. X3. Certainly the ability to filter based on any field or combination of
  532. Xfields.  
  533. X.in 0
  534. X.ne 5
  535. X.hu Warnings and Things to Look Out For
  536. X.sp
  537. XSince this is a pretty simple program, there are a few pitfalls, some
  538. Xof which have already been mentioned;
  539. X.sp
  540. X\f3Order\f1 counts in the rules.  Beware!
  541. X.sp
  542. X\f3Matching\f1 is pretty simple \(em make sure your patterns are sufficiently
  543. Xexclusive before having any destructive rules.
  544. X.sp 2
  545. XFinally, as with the rest of the \f3Elm\f1 mail system, I welcome feedback
  546. Xand suggestion on how to improve this program!!
  547. SHAR_EOF
  548. echo "File doc/Filter.guid is complete"
  549. chmod 0444 doc/Filter.guid || echo "restore of doc/Filter.guid fails"
  550. echo "x - extracting doc/Form.guide (Text)"
  551. sed 's/^X//' << 'SHAR_EOF' > doc/Form.guide &&
  552. X\" @(#)$Id: Form.guide,v 2.8 89/03/29 10:08:51 syd Exp $
  553. X\"
  554. X\"  A guide to using the Elm Forms mode
  555. X\"  format with:
  556. X\"    'troff tmac.n - > Forms.format'
  557. X\"
  558. X\"  Elm is now in the public trust. Bug reports, comments, suggestions, flames
  559. X\"  etc. should go to:
  560. X\"    Syd Weinstein        elm@dsinc.UUCP (dsinc!elm)
  561. X\"
  562. X\"  (C) Copyright 1986, 1987 Dave Taylor
  563. X\"  (C) Copyright 1988, 1989 Usenet Community Trust
  564. X\"
  565. X\"  $Log:    Form.guide,v $
  566. X\" Revision 2.8  89/03/29  10:08:51  syd
  567. X\" First tmac.n checkin
  568. X\" 
  569. X\"  
  570. X.po 1i
  571. X.ds h0
  572. X.ds h1
  573. X.ds h2
  574. X.ds f0
  575. X.ds f1
  576. X.ds f2
  577. X.nr Hy 1
  578. X.nr Pt 1
  579. X.nr Pi 0
  580. X.lg 0
  581. X.rs
  582. X.de eb
  583. X.sp -1    
  584. X.nf
  585. X\h'-.5n'\L'|\\nau-1'\l'\\n(.lu+1n\(ul'\L'-|\\nau+1'\l'|0u-.5n\(ul'
  586. X.fi
  587. X..
  588. X.sp |3.0i
  589. X.ce 99
  590. X.ps 20
  591. X.ss 18
  592. X.vs 12
  593. X\f3Elm Forms Mode Guide\f1
  594. X.sp 7
  595. X.ps 12
  596. X\f2What Forms Mode is, how to use it to create
  597. Xcustom forms, how to reply to forms, and how to
  598. Xuse it for AT&T Mail messages\f1
  599. X.sp 5
  600. XDave Taylor
  601. X.sp
  602. XHewlett-Packard Laboratories
  603. X1501 Page Mill Road
  604. XPalo Alto CA
  605. X94304
  606. X.sp 
  607. Xemail: taylor\s-1@\s+1hplabs.HP.COM  or  hplabs\s-1!\s+1taylor
  608. X.sp 2
  609. X>>> Elm is now in the public trust. Bug reports, comments, etc. to: <<<
  610. X.sp
  611. XSyd Weinstein
  612. XDatacomp Systems, Inc.
  613. X3837 Byron Road
  614. XHuntingdon Valley, PA 19006-2320
  615. X.sp
  616. Xemail: elm\s-1@\s+1dsinc.UUCP  or  dsinc\s-1!\s+1elm
  617. X.sp 4
  618. X.ps 18
  619. X\f3\(co\f1\s12 Copyright 1986, 1987 by Dave Taylor
  620. X.ps 18
  621. X\f3\(co\f1\s12 Copyright 1988, 1989 by The USENET Community Trust
  622. X.ps 10
  623. X.bp 1
  624. X.sp 5
  625. X.ps 14
  626. X\f3A Guide to Forms Mode in Elm\f1
  627. X.ds h0 "Forms Mode Guide
  628. X.ds h1
  629. X.ds h2 "Version 2.2
  630. X.ds f0
  631. X.ds f1 "Page %
  632. X.sp
  633. X.ps 10
  634. X(Version 2.2)
  635. X.sp 
  636. XDave Taylor
  637. X.sp
  638. XHewlett-Packard Laboratories
  639. X1501 Page Mill Road
  640. XPalo Alto CA
  641. X94304
  642. X.sp 
  643. Xemail: taylor\s-1@\s+1hplabs.HP.COM  or  hplabs\s-1!\s+1taylor
  644. X.sp 2
  645. X>>> Elm is now in the public trust. Bug reports, comments, etc. to: <<<
  646. X.sp
  647. X.sp
  648. XSyd Weinstein
  649. XDatacomp Systems, Inc.
  650. X3837 Byron Road
  651. XHuntingdon Valley, PA 19006-2320
  652. X.sp
  653. Xemail: elm\s-1@\s+1dsinc.UUCP  or  dsinc\s-1!\s+1elm
  654. X.sp
  655. XApril 1, 1989
  656. X.ce 0
  657. X.sp 2
  658. XWhile there are a lot of mail systems that allow the transmission 
  659. Xof text and primitive pictures, to send and reply to more complex
  660. Xforms is simply not possible.  \f3Elm\f1, however, took
  661. Xthe forms mode implemented as part of the AT&T Mail package and has
  662. Xexpanded on it to be a smoothly fit part of the overall mail system.
  663. X.sp
  664. XForms mode gives you the ability to send `template' files to people 
  665. Xand receive the filled-in replies.\s-2\u1\d\s0
  666. X.fn
  667. X\f21. note that this feature assumes that the person on the other end
  668. Xis also using the Elm mail system.\f1
  669. X.ef
  670. XLet's look at an example right off.
  671. X.sp
  672. XSay we were going to use computer mail as a way to file defects with
  673. Xsoftware.  There is a certain amount of information we want to be able
  674. Xto collect when each report is made, and if it is in a specific format
  675. Xwe can use programs to file the defects upon receipt.
  676. X.sp
  677. XThe form we'll try to emulate starts out looking like:
  678. X.\" A manual page break has been done because the 'sd' macro doesn't like
  679. X.\" coming up right after the footer or just doesn't like going to a new
  680. X.\" page by itself.  The bug has been reported.
  681. X.bp
  682. X.ft CW
  683. X.sd c
  684. X.mk a
  685. X.sp
  686. X.tl ''Defect Reporting Form''
  687. X.sp
  688. X.tl 'Program:\ \l'2.3i-\w'Program:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u''
  689. X.tl 'Operating\ System:\ \l'2.3i-\w'Operating\ System:\ 'u'''Version:\ \l'1.7i-\w'Version:\ 'u''
  690. X.sp
  691. X.tl 'Defect\ Type:\ \l'2.3i-\w'Defect\ Type:\ 'u'''
  692. X.sp
  693. X.tl 'Date\ Found:\ \l'2.3i-\w'Date\ Found:\ 'u'''By\ Whom:\ \l'2.3i-\w'By\ Whom:\ 'u'\h'.2i''
  694. X.tl 'Date\ Reported:\ \l'2.3i-\w'Date\ Reported:\ 'u'''Phone:\ \l'2.3i-\w'Phone:\ 'u'\h'.2i''
  695. X.sp
  696. X.tl 'Description:\ \l'6.4i-\w'Description:\ 'u''
  697. X.tl '\l'6.4i''
  698. X.tl '\l'6.4i''
  699. X.sp
  700. X.eb
  701. X.ed
  702. X.ft 1
  703. X.sp
  704. XThis form can actually be created almost exactly as listed above in 
  705. Xthe \f3Elm\f1 mail system by using your standard editor and can then
  706. Xbe mailed about as needed.
  707. X.sp
  708. XLet's say that we want a bit more information, however, especially with 
  709. Xfields like ``Defect Type'', we want to list all the recommended answers.
  710. XTo create the actual form, we need merely to replace the underlines in
  711. Xthe above form with spaces.  The multi-line comments can simply be 
  712. Xindicated by a `:' by itself on a line;
  713. X
  714. X.ft CW
  715. X.sd c
  716. X.mk a
  717. X.sp
  718. X.tl ''Defect Reporting Form''
  719. X.sp
  720. X.tl 'Program:''Version:\h'1.7i-\w'Version:'u''
  721. X.tl 'Operating System:''Version:\h'1.7i-\w'Version:'u''
  722. X.sp
  723. X.tl '(Valid Defect Types are: user-error, doc-error, fatal, other)'
  724. X.tl 'Defect Type:''
  725. X.sp
  726. X.tl 'Date Found:''By\ Whom:\h'2.3i-\w'By\ Whom:'u''
  727. X.tl 'Date Reported:''Phone:\h'2.3i-\w'Phone:'u''
  728. X.sp
  729. X.tl 'Description'
  730. X.tl ':'
  731. X.sp
  732. XThank you for filling in this form.
  733. X.sp 2
  734. X.eb
  735. X.ed
  736. X.ft 1
  737. X.sp
  738. XAs we can see, it is quite simple to create forms!!  
  739. X.sp 2
  740. XNow that we have an idea what we're talking about, let's actually officially
  741. Xdefine the system...
  742. X.br
  743. X.ne 5
  744. X.hu Forms Mode Specification
  745. X
  746. X[Note that this is all taken from the document \f2Standard for Exchanging
  747. XForms on AT&T Mail\f1, Version 1.9 of 6/7/86, from AT&T]
  748. X.sp
  749. XThe forms mode is really quite simple.  Simple enough that it is amazing
  750. Xthat it hadn't been implemented before AT&T Mail came along!!
  751. X.sp
  752. XIn a nutshell, each field is delimited by a `:' followed by a number of
  753. Xblank spaces or tabs that represent the valid size for that field.  That
  754. Xis, if we have a line in the form like;
  755. X.nf
  756. X.ti .5i
  757. X``Phone (area-code):\0\0\0\0\0Number:\0\0\0\0\0\0\0\0\0\0'' 
  758. X.fi
  759. XThe area-code field will be limited to three characters and the number to nine.
  760. X(this is kind of hard to see with the proportionally spaced formatted copy,
  761. Xalas).
  762. XThe only exception to the rule is that a `:' by itself on a line represents
  763. Xa field that is as large as the user entering the data desires.
  764. X
  765. XThe actual form that is transmitted, in AT&T Mail parlance, is a ``SIMPLE''
  766. Xforms handler message (as opposed to the ``ADVANCED'' handler).  This means
  767. Xthat it contains three sections;
  768. X.br
  769. X.ne 8
  770. X.nf
  771. X.in .5i
  772. X\f2The Message Header\fC
  773. X[OPTIONS-SECTION]
  774. X***
  775. X[FORMS-IMAGE]
  776. X***
  777. X[RULES-SECTION]\f1
  778. X.in 0
  779. X.fi
  780. X\f3Elm\f1 generates form messages with the ``options'' section filled out,
  781. Xbut ignores it when receiving mail.  The filled out section is:\fC
  782. X.nf
  783. X.in .5i
  784. XWIDTH=80
  785. XTYPE=SIMPLE
  786. XOUTPUT=TEXT\f1
  787. X.in 0
  788. X.fi
  789. XThe FORMS-IMAGE section is that described above.  The RULES-SECTION can
  790. Xcontain explicit rules about the possible values of each field, but 
  791. Xthis is currently ignored by \f3Elm\f1, being a ``SIMPLE'' forms mode
  792. Xmail system.
  793. X.sp
  794. XForms also have the header ``Content-Type: mailform'' to indicate to the
  795. Xmail system (either \f3Elm\f1 or AT&T Mail) that a form is being sent.
  796. X.sp
  797. X\f3Elm\f1 further indicates that a form has been received by having an
  798. X``F'' as the status character in the header display section (instead of
  799. X``N'' for new, etc).
  800. X.br
  801. X.ne 5
  802. X.hu Composing and Sending a Form
  803. X
  804. XThe first step to enable sending forms is to change the setting of
  805. Xthe variable \f2forms\f1 in your \f2.elmrc\f1 file to ``ON''.  E.g.:
  806. X.nf
  807. X.ti .5i
  808. Xforms = ON
  809. X.fi
  810. XThe next step is to send the message to someone using the `m' (\f2mail\f1)
  811. Xcommand.  This then will drop you into an editor.  Type in the form as
  812. Xindicated above, with appropriate colons and comments, and end the entry
  813. Xby leaving the editor.
  814. X.sp
  815. XThe prompt is now;
  816. X.nf
  817. X.ft CW
  818. X.tl ''Choose: E)dit msg, edit H)eaders, M)ake form, S)end or F)orget : @''
  819. X.ft 1
  820. X.fi
  821. Xso we choose `m' \(em \f2Make form\f1.  The program then will either
  822. Xrewrite the prompt without the M)ake form option, indicating that
  823. Xthe form has been accepted, or will indicate the problem and give you
  824. Xa chance to correct it.
  825. X.sp
  826. XOnce it has been accepted, simple use the `s' \(em \f2send message\f1 -
  827. Xcommand and it's off!
  828. X.sp 
  829. X\f2Note that you cannot reply to a message with a Form.\f1
  830. X.br
  831. X.ne 6
  832. X.hu Replying to a Form
  833. X
  834. XLet's reply to the form message we generated now.  The header page of the
  835. X\f3Elm\f1 mail system will indicate that the message is a form by having
  836. Xan `F' next to it.  So we use `r' to reply and the screen is immediately
  837. Xcleared and we're prompted, field by field, for the data requested.
  838. XEach field has underscores in the input area to indicate the size field that
  839. Xis expected.
  840. X.sp
  841. XAfter answering all the questions we'll have a screen that looks like;
  842. X
  843. X.ft CW
  844. X.sd c
  845. X.mk a
  846. X.sp
  847. X.tl ''Defect Reporting Form''
  848. X.sp
  849. X Program:  \f3The Elm Mail System\f1\l'3i-\w'\f3The Elm Mail System'u'
  850. X Version:  \f31.5\f1\l'3i-\w'\f31.5'u'
  851. X Operating System:  \f3HP-UX\f1\l'3i-\w'\f3HP-UX'u'
  852. X Version:  \f35.141 C\f1\l'3i-\w'\f35.141 C'u'
  853. X.sp
  854. X (Valid Defect Types are: user-error, doc-error, fatal, other)
  855. X Defect Type:  \f3fatal\f1\l'5i-\w'\f3fatal\f1'u'
  856. X.sp
  857. X Date Found:  \f310/9/86\f1\l'3i-\w'\f310/9/86\f1'u'
  858. X By Whom:  \f3Dave Taylor\f1\l'3i-\w'\f3Dave Taylor\f1'u'
  859. X Date Reported:  \f310/9/86\f1\l'3i-\w'\f310/9/86\f1'u'
  860. X Phone:  \f3(415) 857-6887\f1\l'3i-\w'\f3(415) 857-6887\f1'u'
  861. X.sp
  862. X Description
  863. X (Enter as many lines as needed, ending with a `.' by itself on a line)
  864. X   \f3When running it on a CPM system I cannot compile successfully.\f1
  865. X   \f3.\f1
  866. X Thank you for filling in this form.
  867. X.tl ''Choose: E)dit form, edit H)eaders, S)end or F)orget : @''
  868. X.sp 
  869. X.eb
  870. X.ed
  871. X.ft 1
  872. X.sp
  873. XQuite simple.  Notice, however, that the order of prompting is left to
  874. Xright on each line, so the fields that on the form are placed in what
  875. Xseems like a logical place, ``By Whom:'' and ``Phone:'' turn out to be
  876. Xconfusing when filling in the actual form since it isn't clear what
  877. X``Phone:'' is being asked for because of the intervention of the
  878. X``Date Reported:'' field.
  879. X.sp 
  880. XThe message that will actually be sent out from this will have the
  881. Xfields in a more acceptable format;
  882. X.\" Force page break, as there seems to be a bug in the .sd macro
  883. X.bp
  884. X.\"
  885. X.ft CW
  886. X.mk a
  887. X.sp
  888. X WIDTH=80
  889. X TYPE=SIMPLE
  890. X OUTPUT=TEXT
  891. X ***
  892. X.tl ''Defect Reporting Form''
  893. X.sp
  894. X.tl ' Program: The Elm Mail System''Version: 1.5\h'1.5i-\w'Version: 1.5'u''
  895. X.tl ' Operating System: HP-UX''Version: 5.141 C\h'1.5i-\w'Version: 5.141 C'u''
  896. X.sp
  897. X.tl ' (Valid Defect Types are: user-error, doc-error, fatal, other)'
  898. X.tl ' Defect Type: fatal''
  899. X.sp
  900. X.tl ' Date Found: 10/9/86''By Whom: Dave Taylor\h'2.3i-\w'By Whom: Dave Taylor'u''
  901. X.tl ' Date Reported: 10/9/86''Phone: (415) 857-6887\h'2.3i-\w'Phone: (415) 857-6887'u''
  902. X.sp
  903. X.tl ' Description'
  904. X.sp
  905. X    When running it on a CPM system I cannot compile successfully.
  906. X.sp 
  907. X.tl ' Thank you for filling in this form.'
  908. X ***
  909. X.sp
  910. X.eb
  911. X.ft 1
  912. X
  913. X.hu Comments on Forms Mode
  914. X
  915. XAs was said at the beginning, this way of sending about forms could
  916. Xprove to be very helpful and useful in a variety of contexts.  On the
  917. Xother hand, until a more sophisticated forms language is used for the
  918. Xforms, this should be sufficient to embody the power of the idea.
  919. X.sp
  920. XI welcome any comments and thoughts on this system and also welcome
  921. Xpossible enhancements.
  922. X.sp
  923. XI also gratefully thank Dale DeJager of AT&T Information Systems 
  924. Xfor sending me more
  925. Xinformation on AT&T Mail than I could possibly digest in any finite
  926. Xamount of time.
  927. SHAR_EOF
  928. chmod 0444 doc/Form.guide || echo "restore of doc/Form.guide fails"
  929. echo "x - extracting doc/Makefile.SH (Text)"
  930. sed 's/^X//' << 'SHAR_EOF' > doc/Makefile.SH &&
  931. Xcase $CONFIG in
  932. X'')
  933. X    if test ! -f config.sh; then
  934. X    ln ../config.sh . || \
  935. X    ln ../../config.sh . || \
  936. X    ln ../../../config.sh . || \
  937. X    (echo "Can't find config.sh."; exit 1)
  938. X    fi
  939. X    . ./config.sh
  940. X    ;;
  941. Xesac
  942. Xcase "$0" in
  943. X*/*) cd `expr X$0 : 'X\(.*\)/'` ;;
  944. Xesac
  945. X
  946. Xecho "Extracting doc/Makefile (with variable substitutions)"
  947. Xcat >Makefile <<!GROK!THIS!
  948. X#
  949. X# $Id: Makefile.SH,v 2.8 89/03/30 16:01:35 syd Exp $
  950. X#
  951. X#  Makefile for the documentation of the ELM mail system
  952. X#
  953. X#         (C) Copyright 1989, USENET Community Trust
  954. X#
  955. X#  $Log:    Makefile.SH,v $
  956. X# Revision 2.8  89/03/30  16:01:35  syd
  957. X# First tmac.n checkin
  958. X# 
  959. X#
  960. X# Variables
  961. X#    Variables established by Configure
  962. XCHMOD        =    $chmod
  963. XCP        =    $cp
  964. XDEST        =    $bin
  965. XECHO        =    $echo
  966. XFORMATTER    =    $roff
  967. XLIB        =    $lib
  968. XLN        =    $ln
  969. XMAN        =    $mansrc
  970. XMANEXT        =    $manext
  971. XRM        =     $rm -f
  972. XTBL           =    $tbl
  973. X!GROK!THIS!
  974. X
  975. Xcat >>Makefile <<'!NO!SUBS!'
  976. X
  977. X#    Other variables
  978. XSHELL        =    /bin/sh
  979. X
  980. X# List of installed man pages (except for wnemail.1 - handled differently)
  981. XMAN_LIST        =    $(MAN)/answer.$(MANEXT)        \
  982. X                $(MAN)/autoreply.$(MANEXT)    \
  983. X                $(MAN)/checkalias.$(MANEXT)    \
  984. X                $(MAN)/elm.$(MANEXT)        \
  985. X                $(MAN)/fastmail.$(MANEXT)    \
  986. X                $(MAN)/filter.$(MANEXT)        \
  987. X                $(MAN)/frm.$(MANEXT)        \
  988. X                $(MAN)/listalias.$(MANEXT)    \
  989. X                $(MAN)/messages.$(MANEXT)    \
  990. X                $(MAN)/newalias.$(MANEXT)    \
  991. X                $(MAN)/printmail.$(MANEXT)    \
  992. X                $(MAN)/readmsg.$(MANEXT)
  993. X
  994. X# List of remotely installed man pages (except for wnemail.1 - handled
  995. X# differently)
  996. XREMOTE_MAN_LIST        =    $(REMOTE)$(MAN)/answer.$(MANEXT)    \
  997. X                $(REMOTE)$(MAN)/autoreply.$(MANEXT)    \
  998. X                $(REMOTE)$(MAN)/checkalias.$(MANEXT)    \
  999. X                $(REMOTE)$(MAN)/elm.$(MANEXT)        \
  1000. X                $(REMOTE)$(MAN)/fastmail.$(MANEXT)    \
  1001. X                $(REMOTE)$(MAN)/filter.$(MANEXT)    \
  1002. X                $(REMOTE)$(MAN)/frm.$(MANEXT)        \
  1003. X                $(REMOTE)$(MAN)/listalias.$(MANEXT)    \
  1004. X                $(REMOTE)$(MAN)/messages.$(MANEXT)    \
  1005. X                $(REMOTE)$(MAN)/newalias.$(MANEXT)    \
  1006. X                $(REMOTE)$(MAN)/printmail.$(MANEXT)    \
  1007. X                $(REMOTE)$(MAN)/readmsg.$(MANEXT)
  1008. X
  1009. X# List of files installed in LIB directory
  1010. XLIB_LIST        =    $(LIB)/elm-help.0    \
  1011. X                $(LIB)/elm-help.1    \
  1012. X                $(LIB)/elm-help.2    \
  1013. X                $(LIB)/elm-help.3    \
  1014. X                $(LIB)/elmrc-info
  1015. X
  1016. X# List of files installed in remote LIB directory
  1017. XREMOTE_LIB_LIST        =    $(REMOTE)$(LIB)/elm-help.0    \
  1018. X                $(REMOTE)$(LIB)/elm-help.1    \
  1019. X                $(REMOTE)$(LIB)/elm-help.2    \
  1020. X                $(REMOTE)$(LIB)/elm-help.3    \
  1021. X                $(REMOTE)$(LIB)/elmrc-info
  1022. X
  1023. X# List of formatted guides
  1024. XFORMATTED_LIST        =    Alias.fmtd    \
  1025. X                Config.fmtd     \
  1026. X                Cover.fmtd    \
  1027. X                Filter.fmtd    \
  1028. X                Form.fmtd    \
  1029. X                Ref.fmtd    \
  1030. X                Users.fmtd
  1031. X
  1032. X# Targets
  1033. X#    The following are no-ops
  1034. Xall:
  1035. Xlint:
  1036. Xclean:    
  1037. X
  1038. Xinstall:    $(LIB_LIST) $(MAN_LIST) $(MAN)/wnewmail.$(MANEXT)
  1039. X
  1040. X#    Dependencies and rules for installing man pages and lib files
  1041. X#    taken from a remote system
  1042. X#    This is the only target that gets installed even if not out-of-date
  1043. X#    with respect the files from which it is installed.
  1044. Xrmt-install:    rmt-defined
  1045. X        $(RM) $(MAN)/newmail.$(MANEXT) $(MAN)/wnewmail.$(MANEXT)
  1046. X        $(CP) $(REMOTE_MAN_LIST) $(MAN)
  1047. X        $(CHMOD) u+w,a+r $(MAN_LIST)
  1048. X        $(LN) $(MAN)/newmail.$(MANEXT) $(MAN)/wnewmail.$(MANEXT)
  1049. X        $(CP) $(REMOTE_LIB_LIST) $(LIB)
  1050. X        $(CHMOD) u+w,a+r $(LIB_LIST)
  1051. X
  1052. Xrmt-defined:
  1053. X    @(if [ "$(REMOTE)" = "" ];\
  1054. X      then\
  1055. X        $(ECHO) "You need to define 'REMOTE' as the remote file system";\
  1056. X        $(ECHO) "for this particular command. The easiest way to do this";\
  1057. X        $(ECHO) "to type:";\
  1058. X        $(ECHO) "        make REMOTE=<remote file system> rmt-install";\
  1059. X        exit 1;\
  1060. X      fi);
  1061. X
  1062. X#    Dependencies and rules for installing man pages and lib files
  1063. X$(MAN)/answer.$(MANEXT):    answer.1
  1064. X                $(CP) $? $@
  1065. X                $(CHMOD) u+w,a+r $@
  1066. X
  1067. X$(MAN)/autoreply.$(MANEXT):    autoreply.1
  1068. X                $(CP) $? $@
  1069. X                $(CHMOD) u+w,a+r $@
  1070. X
  1071. X$(MAN)/checkalias.$(MANEXT):    chkalias.1
  1072. X                $(CP) $? $@
  1073. X                $(CHMOD) u+w,a+r $@
  1074. X
  1075. X$(MAN)/elm.$(MANEXT):        elm.1
  1076. X                $(CP) $? $@
  1077. X                $(CHMOD) u+w,a+r $@
  1078. X
  1079. X$(MAN)/fastmail.$(MANEXT):    fastmail.1
  1080. X                $(CP) $? $@
  1081. X                $(CHMOD) u+w,a+r $@
  1082. X
  1083. X$(MAN)/filter.$(MANEXT):    filter.1
  1084. X                $(CP) $? $@
  1085. X                $(CHMOD) u+w,a+r $@
  1086. X
  1087. X$(MAN)/frm.$(MANEXT):        frm.1
  1088. X                $(CP) $? $@
  1089. X                $(CHMOD) u+w,a+r $@
  1090. X
  1091. X$(MAN)/listalias.$(MANEXT):    listalias.1
  1092. X                $(CP) $? $@
  1093. X                $(CHMOD) u+w,a+r $@
  1094. X
  1095. X$(MAN)/messages.$(MANEXT):    messages.1
  1096. X                $(CP) $? $@
  1097. X                $(CHMOD) u+w,a+r $@
  1098. X
  1099. X$(MAN)/newalias.$(MANEXT):    newalias.1
  1100. X                $(CP) $? $@
  1101. X                $(CHMOD) u+w,a+r $@
  1102. X
  1103. X$(MAN)/newmail.$(MANEXT):    newmail.1
  1104. X                $(RM) $@
  1105. X                $(CP) $? $@
  1106. X                $(CHMOD) u+w,a+r $@
  1107. X
  1108. X$(MAN)/printmail.$(MANEXT):    printmail.1
  1109. X                $(CP) $? $@
  1110. X                $(CHMOD) u+w,a+r $@
  1111. X
  1112. X$(MAN)/readmsg.$(MANEXT):    readmsg.1
  1113. X                $(CP) $? $@
  1114. X                $(CHMOD) u+w,a+r $@
  1115. X
  1116. X$(MAN)/wnewmail.$(MANEXT):    $(MAN)/newmail.$(MANEXT)
  1117. X                $(RM) $@
  1118. X                $(LN) $? $@
  1119. X
  1120. X$(LIB)/elm-help.0:        elm-help.0
  1121. X                $(CP) $? $@
  1122. X                $(CHMOD) u+w,a+r $@
  1123. X
  1124. X$(LIB)/elm-help.1:        elm-help.1
  1125. X                $(CP) $? $@
  1126. X                $(CHMOD) u+w,a+r $@
  1127. X
  1128. X$(LIB)/elm-help.2:        elm-help.2
  1129. X                $(CP) $? $@
  1130. X                $(CHMOD) u+w,a+r $@
  1131. X
  1132. X$(LIB)/elm-help.3:        elm-help.3
  1133. X                $(CP) $? $@
  1134. X                $(CHMOD) u+w,a+r $@
  1135. X
  1136. X$(LIB)/elmrc-info:        elmrc-info
  1137. X                $(CP) $? $@
  1138. X                $(CHMOD) u+w,a+r $@
  1139. X
  1140. X#    Dependencies and rules for formatting guides
  1141. Xdocumentation:    $(FORMATTED_LIST)
  1142. X
  1143. XAlias.fmtd:    Alias.guide
  1144. X        $(TBL) $? | $(FORMATTER) tmac.n - > $@
  1145. X
  1146. XConfig.fmtd:    Config.guid
  1147. X        $(TBL) $? | $(FORMATTER) tmac.n - > $@
  1148. X
  1149. XCover.fmtd:    Elm.cover
  1150. X        $(FORMATTER) tmac.n $? > $@
  1151. X
  1152. XFilter.fmtd:    Filter.guid
  1153. X        $(TBL) $? | $(FORMATTER) tmac.n - > $@
  1154. X
  1155. XForm.fmtd:    Form.guide
  1156. X        $(FORMATTER) tmac.n $? > $@
  1157. X
  1158. XRef.fmtd:    Ref.guide
  1159. X        $(FORMATTER) tmac.n $? > $@
  1160. X
  1161. XUsers.fmtd:    Users.guide
  1162. X        $(TBL) $? | $(FORMATTER) tmac.n - > $@
  1163. X!NO!SUBS!
  1164. SHAR_EOF
  1165. chmod 0444 doc/Makefile.SH || echo "restore of doc/Makefile.SH fails"
  1166. echo "x - extracting doc/Ref.guide (Text)"
  1167. sed 's/^X//' << 'SHAR_EOF' > doc/Ref.guide &&
  1168. X\" @(#)$Id: Ref.guide,v 2.23 89/03/31 11:19:34 syd Exp $
  1169. X\"
  1170. X\"  Reference guide to the Elm mail system.
  1171. X\"  format with 
  1172. X\"      troff tmac.n Ref.guide > Ref.format
  1173. X\"
  1174. X\"  Elm is now in the public trust. Bug reports, comments, suggestions, flames
  1175. X\"  etc. should go to:
  1176. X\"    Syd Weinstein        elm@dsinc.UUCP (dsinc!elm)
  1177. X\"
  1178. X\"  (C) Copyright 1986, 1987 Dave Taylor
  1179. X\"  (C) Copyright 1988, 1989 Usenet Community Trust
  1180. X\"
  1181. X\"  $Log:    Ref.guide,v $
  1182. X\" Revision 2.23  89/03/31  11:19:34  syd
  1183. X\" Release 2.2 checkin
  1184. X\" 
  1185. X\"
  1186. X.po 1i
  1187. X.ds h0
  1188. X.ds h1
  1189. X.ds h2
  1190. X.ds f0
  1191. X.ds f1
  1192. X.ds f2
  1193. X.nr Hy 1
  1194. X.nr Pt 1
  1195. X.nr Pi 0
  1196. X.lg 0
  1197. X.rs
  1198. X.za
  1199. X.sp |3.0i
  1200. X.ce 99
  1201. X.ps 20
  1202. X.ss 18
  1203. X.vs 12
  1204. X\f3The Elm Reference Guide\f1
  1205. X.sp 5
  1206. X.ps 12
  1207. X\f2A comprehensive list of all commands, 
  1208. Xoptions and such to the \f3Elm\fP mail system\f1
  1209. X.sp 5
  1210. XDave Taylor
  1211. X.sp
  1212. XHewlett-Packard Laboratories
  1213. X1501 Page Mill Road
  1214. XPalo Alto CA
  1215. X94304
  1216. X.sp
  1217. Xemail: taylor@hplabs.HP.COM or hplabs!taylor
  1218. X.sp 4
  1219. X>>> Elm is now in the public trust. Bug reports, comments, etc. to: <<<
  1220. X.sp
  1221. XSyd Weinstein
  1222. XDatacomp Systems, Inc.
  1223. X3837 Byron Road
  1224. XHuntingdon Valley, PA 19006-2320
  1225. X.sp
  1226. Xemail: elm\s-1@\s+1dsinc.UUCP  or  dsinc\s-1!\s+1elm
  1227. X.sp 4
  1228. X.ps 18
  1229. X\f3\(co\f1\s12 Copyright 1986, 1987 by Dave Taylor
  1230. X.ps 18
  1231. X\f3\(co\f1\s12 Copyright 1988, 1989 by The USENET Community Trust
  1232. X.ce 0
  1233. X.bp 1
  1234. X.ce 99
  1235. X.ps 14
  1236. X\f3The Elm Reference Guide\f1
  1237. X.ds h0 "Elm Reference Guide
  1238. X.ds h1
  1239. X.ds h2 "Version 2.2
  1240. X.ds f0
  1241. X.ds f1 "Page %
  1242. X.sp
  1243. X.ps 10
  1244. X(Version 2.2)
  1245. X.sp 2
  1246. XDave Taylor
  1247. XHewlett-Packard Laboratories
  1248. X1501 Page Mill Road
  1249. XPalo Alto CA
  1250. X94304
  1251. X.sp
  1252. Xemail: taylor@hplabs.HP.COM or hplabs!taylor
  1253. X.sp 2
  1254. X>>> Elm is now in the public trust. Bug reports, comments, etc. to: <<<
  1255. X.sp
  1256. XSyd Weinstein
  1257. XDatacomp Systems, Inc.
  1258. X3837 Byron Road
  1259. XHuntingdon Valley, PA 19006-2320
  1260. X.sp
  1261. Xemail: elm\s-1@\s+1dsinc.UUCP  or  dsinc\s-1!\s+1elm
  1262. X.sp 2
  1263. XApril 1, 1989
  1264. X.ce 0
  1265. X.sp 3 
  1266. X.hn 1 Introduction
  1267. X
  1268. XThere are many parts to a complex software system and \f3The Elm
  1269. XMail System\f1
  1270. Xis no different.  This document describes fully all the options 
  1271. Xavailable in the mailer, including the command line options,
  1272. Xthe commands (in considerably more detail than
  1273. Xin \f2The Elm Users Guide\f1) and 
  1274. Xthe \f2.elm/elmrc\f1 file.
  1275. X
  1276. XTo be more explicit, this document covers:
  1277. Xa discussion of 
  1278. Xthe \f2.elm/elmrc\f1 file,
  1279. Xcommand line options of \f2elm\f1, 
  1280. Xoutgoing mail processing,
  1281. Xresponses of various commands,
  1282. Xmail archive folders,
  1283. Xthe Alias system,
  1284. Xsystem aliases etc,
  1285. Xmore on the \f3Elm\f1 utilities,
  1286. Xand a section for expert mail users.
  1287. X
  1288. XWithout any further ado, then, let's get this show on the road!!
  1289. X.sp
  1290. X.hn 1 "The .elm/elmrc File"
  1291. X
  1292. XElm, like lots of other software on the
  1293. XUnix\v'-.3'\s5TM\s10\v'.3' system, has the ability to automatically read 
  1294. Xin a configuration file at each invocation.  The file must be
  1295. Xcalled \f2elmrc\f1 and reside in the \f2.elm\f1 directory located
  1296. Xin your home directory.  It can have any of the entries below, in any order.
  1297. XIf you are missing any entries, or if you don't have an \f2.elm/elmrc\f1
  1298. Xfile, the default values (listed below for each option) will be used.
  1299. XNote that those options below designated with * can be altered
  1300. Xusing elm via the o)ptions screen.
  1301. XAlso note that when you save a new \f2.elm/elmrc\f1 file via the `>' command
  1302. Xof the options
  1303. Xscreen, it will be (re)created including even those options that
  1304. Xhave default values.
  1305. X.br
  1306. X.sp 
  1307. X.ne 8
  1308. X.hu String Variables
  1309. X
  1310. X.lp alternatives 1.0i
  1311. XThis is a list of other machine/username combinations
  1312. Xthat you receive mail from (forwarded).  This is used 
  1313. Xwhen the \f2group reply\f1 feature is invoked to ensure that
  1314. Xyou don't send yourself a copy of the outbound message.
  1315. X(The default is a list of no alternatives.)
  1316. X
  1317. X.lp calendar* 1.0i
  1318. XThis is used in conjunction with the `<' \f2scan message for
  1319. Xcalendar entries\f1 command, as the file to append any found
  1320. Xcalendar entries to.  (The default is \f2calendar\f1 in your home directory.)
  1321. X
  1322. X.lp editor* 1.0i
  1323. XThe editor to use when typing in new mail.  If you select
  1324. X``none'' or ``builtin'' you'll get a Berkeley Mail style
  1325. Xinterface for all mail that doesn't already have text
  1326. Xin the buffer (e.g. a reply, mail with a ``signature'', etc).
  1327. X(The default is to use the value of $EDITOR in your
  1328. Xcurrent environment, and if not set, an editor selected by
  1329. Xthe person who configured \f2elm\f1 for your system.)
  1330. X
  1331. X.lp escape 1.0i
  1332. XThe character used with the ``builtin'' editor (see above)
  1333. Xto escape from text entry to input a command.
  1334. XWhen a line begins with this character, the editor interprets it
  1335. Xas a command rather than as text to add.
  1336. X(The default is ``~''.)
  1337. X
  1338. X.lp fullname* 1.0i
  1339. XThis is the name the mailer will use in messages
  1340. Xyou send.  It is highly recommended that you use your
  1341. Xfull name and nothing strange or unusual, as that can
  1342. Xappear extremely rude to people receiving your mail.
  1343. X(The default is to use the ``gcos'' field from the \f2/etc/passwd\f1 file
  1344. Xon systems that use this field to store full names, and to use the contents
  1345. Xof \f2.fullname\f1 in your home directory on other systems.)
  1346. X
  1347. X.lp maildir* 1.0i
  1348. XThis is your folder directory.
  1349. XWhen you specify a folder name beginning with the `=' metacharacter\s-2\u1\d\s0,
  1350. X.fn
  1351. X1. Note that `%' and `+' are synonymous with `=' throughout \f2elm\f1
  1352. X.ef
  1353. Xit stands for this directory name.  That is,
  1354. Xif you save a message to folder \f2=stuff\f1
  1355. Xthe `=' will be expanded to the current value of \f2maildir\f1.
  1356. X(The default is the directory \f2Mail\fP in your home directory.)
  1357. X
  1358. X.lp pager 1.0i
  1359. XThis is the program to be used to display messages.  You can
  1360. Xspecify ``builtin'' or the name of any standard pager.  If you
  1361. Xuse ``builtin+'', each screenfull of displayed message is
  1362. X``paged'' from the top of your screen with a title line,
  1363. Xwhile ``builtin'' simply ``scrolls up'' subsequent screenfulls once
  1364. Xit has ``paged'' the first screenfull.
  1365. X(The default is to use the value of $PAGER in your
  1366. Xcurrent environment, and if not set, a pager selected by
  1367. Xthe person who configured \f2elm\f1 for your system, quite likely ``builtin+''.)
  1368. X
  1369. X.lp prefix 1.0i
  1370. XWhen you \f2reply\f1 to a message or \f2forward\f1 a message to another person,
  1371. Xyou can optionally include the original message.  Defining the
  1372. Xprefix value here allows you to indicate what the prefix of 
  1373. Xeach included line should be.  (The default is ``>\ '' and is
  1374. Xstandard in the Unix community.)
  1375. X
  1376. X.lp print* 1.0i
  1377. XThis is the command used for printing messages.  There are two
  1378. Xpossible formats for it, either a command that
  1379. Xcan have a filename affixed to (as a suffix) before being
  1380. Xexecuted, or a string that 
  1381. Xcontains the meta-sequence `%s' which will be replaced
  1382. Xby the name of the file before being executed.  Examples of each are:
  1383. X.nf
  1384. X.ft CW
  1385. X    print = print -formfeed
  1386. X    print = pr %s | lpr
  1387. X.ft 1
  1388. X.fi
  1389. X(The default is set by the person who configured \f2elm\f1 for your system.)
  1390. X
  1391. X.lp receivedmail 1.0i
  1392. XThis is the folder to which incoming mail is saved after you've read it.
  1393. XWhen you answer \f2no\f1 (`n') to the ``keep unread messages in 
  1394. Xyour incoming mailbox?'' prompt or \f2yes\f1 (`y') to the ``store read
  1395. Xmessages in your "received" folder?'', this is where the messages go.
  1396. X(The default is "=received", that is,
  1397. Xa folder called \f2received\f1 in your \f2maildir\f1 directory).
  1398. X
  1399. X.lp sentmail* 1.0i
  1400. XThis is the folder to which a copy of outgoing mail is automatically
  1401. Xsaved.  This will only be done if the \f2copy\f1 flag
  1402. Xis turned on (see below).  Also note that if the \f2savename\f1 feature
  1403. X(see below) is enabled then this folder will be ignored since the program
  1404. Xwill save to a folder that has the same name as the login
  1405. Xof the person you're sending to.
  1406. XWhether or not a copy is saved, and to what folder, can be changed just
  1407. Xprior to sending a message, see below.
  1408. X(The default is "=sent", that is,
  1409. Xa folder called \f2received\f1 in your \f2maildir\f1 directory).
  1410. X
  1411. X.lp shell 1.0i
  1412. XThis defines the shell to use when doing ``!'' escapes and
  1413. Xsuch.  (The default is to use the value of $SHELL in your
  1414. Xcurrent environment, and if not set, a shell selected by
  1415. Xthe person who configured \f2elm\f1 for your system.)
  1416. X
  1417. X.lp signature 1.0i
  1418. XThis file, if defined, will be automatically appended to all
  1419. Xoutbound mail before the editor is invoked.  Furthermore, 
  1420. Xif you'd like a different ``.signature'' file for \f2local\f1
  1421. Xmail and \f2remote\f1 mail (remote being via other hosts), 
  1422. Xyou can alternatively define two variables, \f2localsignature\f1
  1423. Xand \f2remotesignature\f1, to have the same functionality.
  1424. X(The default is "localsignature" and "remotesignature" in the \f2.elm\f1
  1425. Xdirectory in your home directory.)
  1426. X
  1427. X.lp sortby* 1.0i
  1428. XYou can have your folder sorted by any of the following ways:
  1429. X.sp
  1430. X.ta 1i
  1431. Xfrom    This will sort according to whom each message is \f2from\f1.
  1432. X
  1433. Xlines    This will sort \f2shortest\f1 to \f2longest\f1 by message.
  1434. X
  1435. Xmailbox    This will leave the messages in the order found in the folder.
  1436. X
  1437. Xreceived    This will sort \f2least recently received\f1 to 
  1438. X\f2most recently received\f1.
  1439. X
  1440. Xsent    This will sort \f2least recently sent\f1 to \f2most recently sent\f1.
  1441. X
  1442. Xstatus    This will sort by priority, action, new, tagged, then deleted.
  1443. X
  1444. Xsubject    This will sort according to the \f2subject\f1 of each message.
  1445. X.sp
  1446. XEach of these fields can also optionally be prepended with the
  1447. Xsequence ``reverse-'' to reverse the order of the sort.  This doesn't
  1448. Ximply anything about the order of the message in the folder
  1449. Xitself and affects only their order on the index screen.  (The
  1450. Xdefault is \f2mailbox\f1 order.)
  1451. X
  1452. X.lp weedout 1.0i
  1453. XWhen specifying this option, you can list headers that
  1454. Xyou \f2don't\f1 want to see when you are displaying a message.
  1455. XThis list can continue for as many lines as desired, as 
  1456. Xlong as the continued lines all have leading indentation.
  1457. X(The default is ``Received:'' and others.)
  1458. X.br
  1459. X.ne 8
  1460. X.hu Numeric Variables
  1461. X
  1462. X.lp bounceback 1.0i
  1463. XThis is a hop count threshold value and allows you to
  1464. Xset up the mailer so that when you send mail more than
  1465. X\f2n\f1 machines away, it'll automatically include a
  1466. X``Cc:'' to you through the remote machine.  In practice
  1467. Xthis should be very rarely used.  (Note: this refuses to
  1468. Xbounce mail off an Internet address.  The default is to
  1469. Xhave it set to zero, which disables the function)
  1470. X
  1471. X.lp timeout 1.0i
  1472. XOn more advanced systems, it's nice to start up the 
  1473. Xmailer in a window and let it sit in background 
  1474. Xunless new mail arrives (see \f2wnewmail\f1 for
  1475. Xanother window based program) at which point
  1476. Xit can be brought up to the forefront of the system 
  1477. Xand read.  In this case, it would be quite convenient
  1478. Xto have the mailer internally resynchronize every
  1479. Xso often.  This option specifies the number of seconds that this occurs.
  1480. X.sp
  1481. XThis is also useful for normal terminals, for example you can
  1482. Xleave \f2elm\f1 running at night (I usually do) and when you
  1483. Xcome in in the morning it'll be all ready to read your mail!
  1484. X.sp
  1485. X(The default is a 300 second (5 minute) timeout period).
  1486. X
  1487. X.lp userlevel* 1.0i
  1488. XThis is what the program uses to determine the relative level of
  1489. Xsophistication of the user \(em the values are 0 for a new user (the
  1490. Xdefault), 1 for someone familiar with \f2elm\f1 
  1491. Xuser, and 2 for experts.  Some advanced features are hidden from novice
  1492. Xusers, while experts get less verbose prompt messages.
  1493. X.br
  1494. X.ne 8
  1495. X.hu Boolean Variables
  1496. X
  1497. X.lp alwaysdelete 1.0i
  1498. XWhen set, this changes the default answer
  1499. Xof the prompt ``Delete messages?'' to the indicated value.  (The default is
  1500. Xto have the answer be \f2No\f1 (i.e. alwaysdelete = OFF).)
  1501. X
  1502. X.lp alwaysstore 1.0i
  1503. XThis sets the default
  1504. Xanswer on the ``store read mail in "received" folder'' prompt
  1505. Xto the value indicated.  (The default is to have the default
  1506. Xanswer be \f2No\f1 (i.e., alwaysstore = OFF).)
  1507. X
  1508. X.lp alwayskeep 1.0i
  1509. XThis sets the default answer
  1510. Xon the ``keep unread mail in incoming mailbox''
  1511. XHowever, if you answered \f2No\fP to the ``store read
  1512. Xmail in "received" folder''
  1513. Xit is presumed that you'd also want to keep your unread mail in the
  1514. Xincoming mailbox, too, and the value of alwayskeep is ignored.
  1515. X(The default is to have the
  1516. Xdefault answer be \f2Yes\f1 (i.e., alwayskeep = ON).)
  1517. X
  1518. X.lp arrow* 1.0i
  1519. XSometimes your are forced to use a slow, or ``dumb'' terminal.  In this
  1520. Xcase, you can force the current message pointer to be the ``->''
  1521. Xsequence rather than the inverse bar.  (Note that this is
  1522. Xoverridden by the similar `-a' command line option,
  1523. Xsee below.)  (The default is OFF.)
  1524. X
  1525. X.lp ask 1.0i
  1526. XThis allows you to tell the \f2elm\f1 system that 
  1527. Xyou'd rather not be asked ``Delete Mail?'' and such each time you 
  1528. Xresynchronize a folder or change folders,
  1529. Xand instead it should just use the values of
  1530. X``alwaysdelete'', ``alwaysstore'', and ``awayskeep'' without prompting.
  1531. XNote that when you quit \f2elm\fP, if you use `q', you will be asked
  1532. Xthese questions, and if you use `Q', you won't.
  1533. X(The default is ON, i.e. to ask the questions.)
  1534. X
  1535. X.lp askcc 1.0i
  1536. XIf turned off, this will allow you to send mail without being
  1537. Xpresented the ``Copies to:'' prompt for each message. This
  1538. Xstill allows you to explicitly include addresses in the ``cc''
  1539. Xlist via either ``~c'' in the builtin editor, or via using the
  1540. Xheader editor.  (The default is ON, i.e. to ask about copies.)
  1541. X
  1542. X.lp autocopy 1.0i
  1543. XIf turned on, this will automatically copy
  1544. Xthe text of each message being replied to into the edit
  1545. Xbuffer.  Otherwise you will be prompted as to whether you want
  1546. Xthe message included in yours. (See the \f2prefix\f1 
  1547. Xoption above.)  (The default is OFF.)
  1548. X
  1549. X.lp copy 1.0i
  1550. XThis, in combination with the \f2sentmail\f1 folder, will
  1551. Xallow you to have silent copies of all outgoing mail
  1552. Xmade on the outbound step.  
  1553. XWhether a copy is saved and to which folder can be set prior to sending
  1554. Xa message, see below.
  1555. X(The default is OFF.)
  1556. X
  1557. X.lp keep 1.0i
  1558. XThe mail system has a habit of deleting folders when you've
  1559. Xremoved everything from them.  With this option turned on, it will
  1560. Xinstead preserve them as zero-byte files.
  1561. XThis option does not apply to your incoming mailbox.
  1562. X(The default is OFF.)
  1563. X
  1564. X.lp keypad 1.0i
  1565. XIf on, this tells \f2elm\f1 that you have an HP terminal and enables
  1566. Xthe <NEXT>, <PREV>, <HOME> and <SHIFT-HOME> keys.  (The default is OFF.)
  1567. X
  1568. X.lp menus* 1.0i
  1569. XIf turned off, this will inhibit the Menu display on all of the 
  1570. Xscreen displays within the \f2elm\f1 program.  (Note that this is
  1571. Xoverridden by the similar `-m' command line option,
  1572. Xsee below.)  (The default is ON.)
  1573. X
  1574. X.lp names* 1.0i
  1575. XIf turned off, the primary recipients' address is displayed on your
  1576. Xscreen with their full names when you send a message.  Otherwise,
  1577. Xonly the full names are given.  (The default is ON.)
  1578. X
  1579. X.lp movepage 1.0i
  1580. XIf this is enabled then commands that move through the
  1581. Xfolder by pages (the `+', `-', <right-arrow>, and <left-arrow> keys)
  1582. Xwill also move the current message pointer to the
  1583. Xtop of that page of messages.  If this is turned off 
  1584. Xthen moving through the pages doesn't alter the
  1585. Xcurrent message pointer location.
  1586. X(The default is OFF.)
  1587. X
  1588. X.lp noheader 1.0i
  1589. XThis boolean flag tells the mailer not to include the 
  1590. Xheaders of messages when copying a message into a file
  1591. Xbuffer for replying to or forwarding.
  1592. X(The default is ON.)
  1593. X
  1594. X.lp promptafter 1.0i
  1595. XIf this flag is ON and you use an external pager,
  1596. Xwhen the pager exits, you will be prompted for a command rather
  1597. SHAR_EOF
  1598. echo "End of part 4"
  1599. echo "File doc/Ref.guide is continued in part 5"
  1600. echo "5" > s2_seq_.tmp
  1601. exit 0
  1602.  
  1603.